<!-- extend from base layout -->
{% extends "layout.html" %}

{% block extra_css %}

{% endblock %}

{% block content %}
    <div class="container">
    <!-- header -->
    <nav class="sub-header row container-fluid">
        <ol class="breadcrumb">
            <li><a href="/">首页</a></li>
            <li class="active">提现中心</li>
            <li class="active">提现订单</li>
        </ol>
        <div class="btn-group pull-right" role="group" aria-label="...">
            {% if request.query_string == 'status_rec=2' %}
            <a type="button" class="btn btn-default" href="{{ url_for('order.lists_get') }}">等待收款</a>
            <a type="button" class="btn btn-default" href="{{ url_for('order.lists_get', status_rec=1) }}">收款成功</a>
            <a type="button" class="btn btn-default active">收款失败</a>
            {% elif request.query_string == 'status_rec=1' %}
            <a type="button" class="btn btn-default" href="{{ url_for('order.lists_get') }}">等待收款</a>
            <a type="button" class="btn btn-default active">收款成功</a>
            <a type="button" class="btn btn-default" href="{{ url_for('order.lists_get', status_rec=2) }}">收款失败</a>
            {% else %}
            <a type="button" class="btn btn-default active">等待收款</a>
            <a type="button" class="btn btn-default" href="{{ url_for('order.lists_get', status_rec=1) }}">收款成功</a>
            <a type="button" class="btn btn-default" href="{{ url_for('order.lists_get', status_rec=2) }}">收款失败</a>
            {% endif %}
        </div>
    </nav>

    <hr/>
    <!-- content -->
    <div class="table-responsive">
        {# <table class="table table-striped"> #}
        <table class="table table-hover">
            <thead>
            <tr>
                <th>订单ID</th>
                <th>投资ID</th>
                <th>提现ID</th>
                <th>投资用户</th>
                <th>订单金额</th>
                <th>认证状态</th>
                <th>支付状态</th>
                <th>确认状态</th>
                <th>匹配时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for order, user_profile in pagination.items %}
            <tr class="text-muted">
                <td>{{ order.id }}</td>
                <td>{{ order.apply_put_id }}</td>
                <td>{{ order.apply_get_id }}</td>
                <td>{{ user_profile.nickname }} [{{ order.apply_put_uid }}]</td>
                <td>{{ order.money }}</td>
                <td>{{ order.status_audit | status_audit }}</td>
                <td>{{ order.status_pay | status_pay }}</td>
                <td>{{ order.status_rec | status_rec }}</td>
                <td>{{ moment(order.create_time).format('YYYY-MM-DD HH:mm:ss') }}</td>
                <td>
                    <a class="btn-sm btn-default" href="{{ url_for('order.info_get', order_id=order.id) }}" rel="tooltip" title="订单详情"><span class="glyphicon glyphicon-list-alt"></span> 订单详情</a>
                    <a class="btn-sm btn-default" href="{{ url_for('message.add', user_id=order.apply_put_uid) }}" rel="tooltip" title="留言"><span class="glyphicon glyphicon-list-alt"></span> 留言</a>
                    <a class="btn-sm btn-default" href="{{ url_for('complaint.add', user_id=order.apply_put_uid) }}" rel="tooltip" title="投诉"><span class="glyphicon glyphicon-list-alt"></span> 投诉</a>
{#                    <a href="javascript:void(0);" onclick="order_delete({{ order.id }});" rel="tooltip" title="删除"><span class="glyphicon glyphicon-trash"></span></a>#}
                </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
        {# 翻页 #}
        {% from "macros.html" import render_pagination %}
        {{ render_pagination(pagination, 'order.lists_get') }}
    </div>
    </div>
{% endblock %}

{% block extra_js %}
<script>

</script>
{% endblock %}
